<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="../../../inc/conn.asp"-->
<%


id=checkstr(inHTML(request("id")))
if id="" or not isnumeric(id)  then
response.Write("<script>window.location.href='/';</script>")
response.End()
else 
set rs=server.CreateObject("adodb.recordset")
sql="select * from product where pid="&id&""
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.Write("<script>window.location.href='/';</script>")
response.End
else


'读取路径
typelink_id=rs("type")
For s=1 to 6
	set rss=conn.execute("select fid,id,title from protype where id="&typelink_id&"")
	if not rss.eof then
	   typelink_id=rss("fid")
	   typelink=" > <a href='/shopping/"&rss("id")&"'>"&rss("title")&"</a>"+typelink
	set rss=nothing
	end if
Next
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><%=rs("key")%></title>
<meta name="keywords" content="<%=rs("key")%>" />
<meta name="description" content="<%=rs("desc")%>" />
<link href="favicon.ico" rel="shortcut icon" type="image/x-icon"/>
<link rel="stylesheet" type="text/css" href="/css/style.css" />
<script language="javascript" type="text/javascript" src="/js/pd.js"></script>
<script type="text/javascript" src="/js/jquery.min.js"></script>
<script type="text/javascript" src="/js/jquery.tabs.js"></script>
<script type="text/javascript">
$(function(){
	$('.reg_s_1').Tabs({
		event:'click'
	});
});	

</script>
<script type="text/javascript">
$(document).ready(function(){ 
	$('#select_1').change(function(){ 
		$('#search_1').val($(this).find("option:selected").text());
	});
}); 
$(function (){
  $(".main_class_li").hover(function(){
	$(".child_class",this).show();
  });
  $(".main_class_li").mouseleave(function(){
	$(".child_class",this).hide();
  });
});
</script>

</head>
<body>



<!--#include file="../../common/topshopping.asp"-->



<div class="fullwidth bg2">
	<div class="place ">
		<a href="/">首页</a> &gt; <a href="/shopping">我要代购</a> <%=typelink%>
	</div>
</div>

<!--main-->
<div class="fullwidth bg1">
	<div class="main">
		<div class="clear20"></div>
		<dl class="product_d">
			<dt>
				<img src="<%=rs("pic")%>" width="358" height="358" />
				<span></span>
			</dt>
			<dd>
				<h2><%=rs("title")%></h2>
				<p>品牌: 
				<%
				set rsc=conn.execute("select title from brand where id="&rs("bid")&"")
				if not rsc.eof then
				response.Write rsc("title")
				set rsc=nothing
				end if
				%></p>
                <%if rs("color")<>"" then response.Write "<p>颜色："&rs("color")&"</p>"%>
                <%if rs("size")<>"" then response.Write "<p>规格："&rs("size")&"</p>"%>
				<p><%=rs("Simple")%></p>
				<div class="clear20"></div>
				<div class="clear20"></div>
				<div class="clear20"></div>
				<a href="" class="add_f">收 藏</a>
				<div>
                
                <div class="bdsharebuttonbox"><a class="bds_more" href="#" data-cmd="more"></a><a title="分享到QQ空间" class="bds_qzone" href="#" data-cmd="qzone"></a><a title="分享到新浪微博" class="bds_tsina" href="#" data-cmd="tsina"></a><a title="分享到腾讯微博" class="bds_tqq" href="#" data-cmd="tqq"></a><a title="分享到人人网" class="bds_renren" href="#" data-cmd="renren"></a><a title="分享到微信" class="bds_weixin" href="#" data-cmd="weixin"></a></div>
<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"1","bdMiniList":false,"bdPic":"","bdStyle":"1","bdSize":"16"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>
                
                </div>
			</dd>
		</dl>
		<div class="clear20"></div>
		<div class="reg_box reg_s_1 pro_tab">
			<ul class="tab_menu">
				<li class="current">商品来源</li>
				<li>详细描述</li>
			</ul>
			
			<div class="tab_box">
				<div>
					<p class="pro_tip_1">※日本实体店和购物网站的价格波动较大以及比较经常限购，购买时请注意更新日期和限购数量。</p>
					<p class="pro_tip_1">※预定到仓时间是指购买后到达日本仓库的估计时间。网上购买时一般波动也较大，仅供参考。</p>
					<div class="clear20"></div>
					<table class="stable dg_table_2">
					<tr class="str">
						<th>价格</th>
						<th>更新日期</th>
						<th>商品来源</th>
						<th>预计到仓时间</th>				
						<th>日本国内运费</th>				
						<th>限购数量</th>				
						<th>购买数量</th>				
						<th>备注</th>				
						<th></th>				
					</tr>
					
					
					<%
					set rslist=server.CreateObject("adodb.recordset")
					sql="select * from Source where pid="&rs("pid")&""
					rslist.open sql,conn,1,3
					if not rslist.eof then
					do while not rslist.eof
					   set rsc=conn.execute("select * from shop where sid="&rslist("sid")&"")
					%>
					<script>function myjobchk<%=rslist("id")%>(){if (document.formcn<%=rslist("id")%>.qty.value==""){alert("请输入购买数量！");document.formcn<%=rslist("id")%>.qty.focus();return false;}if(!Checkshuzi(formcn<%=rslist("id")%>.qty.value)){alert("购买数量输入错误");formcn<%=rslist("id")%>.qty.focus();return false;}return(true);}</script>
					<form name="formcn<%=rslist("id")%>" method="post" action="" onSubmit="return myjobchk<%=rslist("id")%>();">
					<tr>
						<td>
							<p class="line150">日元：<%=rslist("price")%></p>
							<p class="line150">人民币：<%=cdbl(rslist("price"))*cdbl(web_rate)%></p>
						</td>
						<td><%=formatdatetime(rslist("Uptime"),2)%></td>
						<td><img src="<%=rsc("iocn")%>"> | <a class="blue"><%=rsc("title")%></a></td>
						<td><%=rslist("Arrivaltime")%>天</td>
						<td>
							<p class="line150">日元： <%=rslist("transCost")%> </p>
							<p class="line150">人民币：<%=cdbl(rslist("transCost"))*cdbl(web_rate)%> </p>
						</td>
						<td><%if rslist("Limited")="0" then response.Write "不限" else response.Write rslist("Limited")%></td>
						<td><input name="qty" type="text" class="text" id="qty" value="" datatype="n" nullmsg="请输入购买数量！" errormsg="只能输入数字！"  /></td>
						<td><input name="content" type="text" class="text_1" id="content" value="" placeholder="如有特殊要求请填写" /></td>
						<td><input type="image" src="/images/dg_xxx_8.jpg">
					    <input type="hidden" name="t" value="y" /><input type="hidden" name="sid" value="<%=rslist("id")%>" /></td>
					</tr>
					</form>
					<%
					   set rsc=nothing
					rslist.movenext
					loop
					rslist.close
					set rslist=nothing
					end if		 
					%> 
					
					
					
					
					
				</table>
				</div>
				
			
                
                <div class="hide">
					<div class="clear20"></div>
					<div class="pro_editor">
						<%=rs("content")%>
					</div>
                    <div class="clear20"></div>
				</div>
                
                				
			</div>
			
			<div class="clear20"></div>
		</div>	
	</div>
</div>

<div class="clear"></div>



<!--#include file="../../common/footerauctions.asp"-->







</body>
</html>

<%
if request.Form("t")="y" then
qty=checkstr(inHTML(request.Form("qty")))
content=checkstr(inHTML(request.Form("content")))
sid=checkstr(inHTML(request.Form("sid")))
uid=checkstr(inHTML(request.cookies("u")("uid")))
if qty="0" then qty=1

if uid="" then
session("returnurl")="/shopping/"&rs("pid")&".html"
response.Redirect "/login"
response.end
end if

if qty="" or sid="" then
response.write"<script>alert('购买数量不能为空');</script>"
response.write"<script>window.history.back(-1);</script>"
response.end
end if

set rsx=server.createobject("adodb.recordset")
sql="select * from cart where uid='"&uid&"' and sid="&sid&""
rsx.open sql,conn,1,3
if not rsx.eof then
'重复
rsx("qty")=rsx("qty")+cdbl(qty)
rsx.update
response.write"<script>alert('加入成功');</script>"
response.write"<script>window.location.href='/shopping/"&rs("pid")&".html';</script>"
else
rsx.addnew
rsx("sid")=sid
rsx("qty")=qty
rsx("content")=content
rsx("uid")=uid
rsx.update
response.write"<script>alert('加入成功');</script>"
response.write"<script>window.location.href='/shopping/"&rs("pid")&".html';</script>"
rsx.close
set rsx=nothing
end if
end if




end if
rs.close
set rs=nothing
end if
%>